var t = require("../export.js");

getApp();

Page({
    data: {
        carslist: [],
        carlunbo: [],
        current: 0,
        options: {}
    },
    onLoad: function(t) {
        this.getCarsList(t), this.getCarLunbo(t);
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {
        var a = this.data.options;
        this.getCarsList(a), this.getCarLunbo(a), t.dg.stopPullDownRefresh();
    },
    onReachBottom: function() {},
    getCarsList: function(a) {
        var n = this;
        t.requestUtil.post(t._DuoguanData.duoguan_host_api_url + "/index.php/addon/DuoguanCar/Api/getCarsList.html", a, function(t) {
            n.setData({
                carslist: t
            });
        });
    },
    getCarLunbo: function(a) {
        var n = this;
        t.requestUtil.post(t._DuoguanData.duoguan_host_api_url + "/index.php/addon/DuoguanCar/Api/getCarLunbo.html", a, function(t) {
            n.setData({
                carlunbo: t
            });
        });
    },
    getcurrent: function(t) {
        var a = t.detail.current;
        this.setData({
            current: a
        });
    },
    ToChexingList: function(a) {
        var n = a.currentTarget.dataset.index, e = a.currentTarget.dataset.id, o = this.data.carslist;
        try {
            t.dg.setStorageSync("CarInfo", o[n]), t.dg.navigateTo({
                url: "/pages/car/select-type/select-type?id=" + e
            });
        } catch (a) {
            t.dg.alert("未获取到此汽车信息");
        }
    }
});